package com.scalar.chiptrack.rma;

import com.scalar.chiptrack.utils.StringUtils;

public class RMALineItem
{
	private int productId   = -1;
	private int rmaId       = -1;
	private int lineItemNo  = -1;
	private int lineItemId  = -1;
	private int quantity    = 0;
    private int poLineItemNo ;
    private int closeQty    = 0;
    private int receiveQty  = 0;

    private String partNumber       = null;
	private String invoiceNumber    = null;
	private String invoiceDate      = null;
    private String serialNumber     = null;
	private String problemDescription = null;
	private String reason           = null;
	private String remarks          = null;
    private String poNumber         = null;
    private String salesOrderNumber = null;
    private String probDescription  = null;
    private String remark           = null;
    private String status           = null;
    private String lineItemCloseDate = null;
    private String isClosed         = null;
    private String holdStatus           = null;

    private boolean isExchange      = false;
    private boolean isCredit        = false;
    private boolean isFa            = false;
    private boolean isCancel        = false;
    private boolean isApproved      = false;

    private double unitPrice        = 0.0;
    private double extendedPrice    = 0.0;

    public int getCloseQty(){
		return closeQty;
	}
	public void setCloseQty(int closeQty ){
		this.closeQty = closeQty;
	}

	public int getProductId(){
		return productId;
	}
	public int getLineItemNo(){
		return lineItemNo;
	}

	public int getRmaId(){
		return rmaId;
	}
	
	public void setRmaId(int rmaId){
		this.rmaId = rmaId;
	}
	
	public int getLineItemId(){
		return lineItemId;
	}
	public void setLineItemId(int lineItemId){
		this.lineItemId = lineItemId;
	}
	
	public void setLineItemNo(int lineItemNo){
		this.lineItemNo = lineItemNo;
	}

	public void setProductId(int productId){
		this.productId = productId;
	}

	public String getPartNumber(){
		return partNumber;
	}

	public void setPartNumber(String partNumber){
		this.partNumber = partNumber;
	}

	public String getInvoiceNumber(){
		return invoiceNumber;
	}

	public void setInvoiceNumber(String invoiceNumber){
		this.invoiceNumber = invoiceNumber;
	}

	public String getInvoiceDate(){
		return invoiceDate;
	}

	public void setInvoiceDate(String invoiceDate){
		this.invoiceDate = invoiceDate;
	}

	public String getSerialNumber(){
		return serialNumber;
	}
	public void setSerialNumber(String serialNumber){
		this.serialNumber = serialNumber;
	}

	public String getProblemDescription(){
		return problemDescription;
	}

	public void setProblemDescription(String problemDescription){
		this.problemDescription = problemDescription;
	}

    public String getProblemDescriptionAsHTML()
    {
        StringBuffer tempProblemDescription=new StringBuffer("");
      if ( problemDescription != null )
      {
        for(int i=0;i<problemDescription.length();i++)
        {
            char ch = problemDescription.charAt(i);
            if(ch=='\n')
            {
                tempProblemDescription.append("<br>");
            }
            else
            {
                tempProblemDescription.append(ch);
            }
        }
      }
        probDescription = tempProblemDescription.toString();
        return probDescription;
    }

    public String getRemarksAsHTML()
    {
        if ( remarks != null )
        {
            StringBuffer tempRemarks=new StringBuffer("");
            for(int i=0;i<remarks.length();i++)
            {
                char ch = remarks.charAt(i);
                if(ch=='\n')
                {
                    tempRemarks.append("<br>");
                }
                else
                {
                    tempRemarks.append(ch);
                }
            }
            remark = tempRemarks.toString();
        }
        return remark;
    }

	public int getQuantity(){
		return quantity;
	}
	
	public void setQuantity(int quantity){
		this.quantity = quantity;
	}
	
	public String getReason(){
		return reason;
	}
	
	public void setReason(String reason){
		this.reason = reason;
	}
	
	public String getRemarks(){
		return remarks;
	}
	public void setRemarks(String remarks){
		this.remarks = remarks;
	}

    public boolean getIsCancel(){
        return this.isCancel;
    }

    public void setIsCancel(boolean isCancel){
        this.isCancel = isCancel;
    }

    public double getUnitPrice(){
        return this.unitPrice;
    }
    public String getUnitPriceAsString()
    {
        return StringUtils.formatAmountWithNoOfDecimals(unitPrice);
    }

    public void setUnitPrice(double unitPrice){
        this.unitPrice = unitPrice;
    }

    public double getExtendedPrice(){
        return this.extendedPrice;
    }
    public String getExtendedPriceAsString()
    {
        return StringUtils.formatAmountWithNoOfDecimals(extendedPrice);
    }

    public void setExtendedPrice(double extendedPrice){
        this.extendedPrice = extendedPrice;
    }

    public int getPoLineItemNo(){
        return this.poLineItemNo;
    }

    public void setPoLineItemNo(int poLineItemNo){
        this.poLineItemNo = poLineItemNo;
    }

    public String getPoNumber(){
        return this.poNumber;
    }

    public void setPoNumber(String poNumber){
        this.poNumber = poNumber;
    }

    public boolean getIsExchange(){
        return this.isExchange;
    }

    public void setIsExchange(boolean isExchange){
        this.isExchange = isExchange;
    }

    public boolean getIsCredit(){
        return this.isCredit;
    }

    public void setIsCredit(boolean isCredit){
        this.isCredit = isCredit;
    }

     public boolean getIsFa(){
        return this.isFa;
    }

    public void setIsFa(boolean isFa){
        this.isFa = isFa;
    }

    public String getIsClosed(){
        return this.isClosed;
    }

    public void setIsClosed(String isClosed){
        this.isClosed = isClosed;
    }

    public String getStatus(){
        return status;
    }

    public void setStatus(String status){
        this.status = status;
    }

    public String getLineItemCloseDate(){
		return lineItemCloseDate;
	}

	public void setLineItemCloseDate(String lineItemCloseDate){
		this.lineItemCloseDate = lineItemCloseDate;
	}


    public int getReceiveQty() {
        return receiveQty;
    }

    public void setReceiveQty(int receiveQty) {
        this.receiveQty = receiveQty;
    }


    public String getSalesOrderNumber() {
        return salesOrderNumber;
    }

    public void setSalesOrderNumber(String salesOrderNumber)
    {
        this.salesOrderNumber = salesOrderNumber;
    }

    public String getHoldStatus() 
    {
        return holdStatus;
    }
    public void setHoldStatus(String holdStatus)
    {
        this.holdStatus = holdStatus;
    }
    public boolean getIsApproved()
    {
        return isApproved;
    }
    public void setIsApproved(boolean isapproved)
    {
        this.isApproved = isapproved;
    }
}